package com.warrior.respository;

import com.warrior.entity.VerifyCodeEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Shawn on 2017/3/20.
 */
@Repository
public interface IVerifyCodeRepository extends JpaRepository<VerifyCodeEntity,String>{

    /**
     * 根据用户手机号查找用户验证码信息
     * @param mobile
     * @return
     */
    List<VerifyCodeEntity> findVerifyCodeEntityByMobileOrderByCreatedAtDesc(String mobile);

    /**
     * 根据id查找用户验证码信息
     * @param id
     * @return
     */
    VerifyCodeEntity findVerifyCodeEntityById(String id);

}
